global snap, tempH, tempV, snapH, snapV, lastClickOn
if (the locH of sprite lastClickOn > (snapH - 25)) and (the locH of sprite lastClickOn < (snapH + 25)) and ((the locV of sprite lastClickOn > (snapV - 25)) and (the locV of sprite lastClickOn < (snapV + 25))) then
if snap = 0 then
set tempH to the mouseH
set tempV to the mouseV
puppetSound("synthdrip.s")
end if
set snap to 1
if (the mouseH > (tempH - 25)) and (the mouseH < (tempH + 25)) and ((the mouseV > (tempV - 25)) and (the mouseV < (tempV + 25))) then
set the locH of sprite lastClickOn to snapH
set the locV of sprite lastClickOn to snapV
else
set the locH of sprite lastClickOn to the mouseH
set the locV of sprite lastClickOn to the mouseV
end if
updateStage()
else
set snap to 0
set the locH of sprite lastClickOn to the mouseH
set the locV of sprite lastClickOn to the mouseV
end if
updateStage()
go(the frame)
end
on mouseUp
global follow, snap, lastClickOn, homeV, homeH, snapH, snapV
set follow to 0
if snap = 1 then
set the locH of sprite lastClickOn to snapH
set the locV of sprite lastClickOn to snapV
updateStage()
wait(20)
if the name of cast the castNum of sprite lastClickOn = "cat" then
puppetSound("toots.s")
updateStage()
wait(20)
go(the frame + 1)
else
set the visible of sprite (lastClickOn - 5) to 1
set the visible of sprite lastClickOn to 0
set the castNum of sprite lastClickOn to the castNum of sprite (lastClickOn - 5)
set the locH of sprite lastClickOn to homeH
set the locV of sprite lastClickOn to homeV
puppetSound("swiper.s")
updateStage()
wait(20)
go(the frame - 1)
end if
else
puppetSound("swipe.s")
set the visible of sprite (lastClickOn - 5) to 1
set the visible of sprite lastClickOn to 0
set the castNum of sprite lastClickOn to the castNum of sprite (lastClickOn - 5)